package com.yunshipei.ui.activity;

import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentTransaction;
import android.support.v7.app.AppCompatActivity;

import com.yunshipei.common.wedigt.YspTitleBar;
import com.yunshipei.enterplorer.R;
import com.yunshipei.ui.fragment.YspConversationListFragment;

import butterknife.Bind;
import butterknife.ButterKnife;
import io.rong.imkit.fragment.ConversationListFragment;

public class MessageActivity extends AppCompatActivity {

    @Bind(R.id.title_bar)
    protected YspTitleBar mTitileBar;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_message);
        ButterKnife.bind(this);
        mTitileBar.setTitle("消息");
        FragmentManager fragmentManager = getSupportFragmentManager();
        FragmentTransaction transaction = fragmentManager.beginTransaction();
        Fragment fragment = fragmentManager.findFragmentById(R.id.fl_conversion_content);
        if (fragment == null) {
            ConversationListFragment conversationListFragment = YspConversationListFragment.newInstance(this);
            transaction.replace(R.id.fl_conversion_content, conversationListFragment, ConversationListFragment.class.getName()).commit();
        }
    }
}
